#-*- coding:utf-8 -*-
from flask import Flask,url_for,redirect,render_template,request
import pc
app = Flask(__name__)


@app.route('/',methods=['GET','POST'])
def index():
    if request.method=='POST':
        i=request.form['username']
        tmp=pc.taobao(i)

        return render_template('index.html',tmp=tmp,ss_text=i)
    else:
        shiyuan=pc.taobao_10baoyou()

        return render_template('index.html',shiyuan=shiyuan)
'''
@app.route('/login/',methods=['get','post'])
def login():
    a=request.args
    if a['username']=='d' and a['password']=='1':
        return render_template('index.html',i=a['username'])
    else:
        error='账号或者密码错误'
        return render_template('login.html',error=error)


'''

if __name__ == '__main__':
    app.run(debug=True)
